﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.ScopedSubPass
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>Represents an active sub pass until disposed.</para>
  /// </summary>
  public struct ScopedSubPass : IDisposable
  {
    private ScriptableRenderContext m_Context;

    internal ScopedSubPass(ScriptableRenderContext context) => this.m_Context = context;

    /// <summary>
    ///   <para>Ends the current sub pass in the ScriptableRenderContext that was used to create the ScopedSubPass.</para>
    /// </summary>
    public void Dispose()
    {
      try
      {
        this.m_Context.EndSubPass();
      }
      catch (Exception ex)
      {
        throw new InvalidOperationException("The ScopedSubPass instance is not valid. This can happen if it was constructed using the default constructor.", ex);
      }
    }
  }
}
